package com.heima.feign.article;

import com.heima.feign.article.fallback.IArticleClientFallback;
import com.heima.feign.config.DefaultFeignConfiguration;
import com.heima.model.article.dtos.ArticleCommentConfigDto;
import com.heima.model.article.dtos.ArticleCommentDto;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.article.pojos.ApArticleConfig;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.StatisticsDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "leadnews-article", configuration = DefaultFeignConfiguration.class)
public interface IArticleClient {


    @PostMapping("/api/v1/article/save")
    public ResponseResult saveArticle(@RequestBody ArticleDto dto);

    @PostMapping("/api/v1/article/newPage")
    PageResponseResult newPage(@RequestBody StatisticsDto dto);

    @GetMapping("/api/v1/article/queryLikesAndConllections")
    ResponseResult queryLikesAndConllections(@RequestParam("wmUserId") Integer wmUserId, @RequestParam("beginDate") Date beginDate, @RequestParam("endDate") Date endDate);



    @PostMapping("/api/v1/article/comment/manage/find_news_comments")
    public PageResponseResult findNewsComments(@RequestBody ArticleCommentDto dto);

    @PostMapping("/api/v1/article/comment/manage/find_config/{id}")
    public ResponseResult findConfig(@PathVariable("id") Long id);

    @PostMapping("/api/v1/article/comment/manage/updateCommentStatus")
    ResponseResult updateCommentStatus(@RequestBody ArticleCommentConfigDto dto);
}
